package buildinjava.java;

/**
 * Tests Java identifier resolution rules.
 *
 * @author Gili Tzabari
 */
public class OuterClass
{
	private DuplicateInterface outerField;

	private static interface DuplicateInterface
	{
		void method();
	}

	private static class InnerClass extends OuterClass
	{
		private static interface DuplicateInterface
		{
			void method();
		}

		private static class DuplicateClass implements DuplicateInterface
		{
			@Override
			public void method()
			{
			}
		}
		// Field definition without a dependency
		private final DuplicateInterface innerField = new DuplicateClass();

		private void method()
		{
			// Method invocation with a dependency
			new InnerClass().innerField.method();

			// Field selection without a dependency
			innerField.method();
		}
	}

	private void callOutside()
	{
		outerField.method();

		Integer externalDependency = Integer.valueOf(5);
	}
}
